package fr.vvins.core.catalog.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;


/**
 * Designation
 */
@Entity
@Table(schema="vvins",name="VV_LIST")

public class ListContent extends EntityImpl implements Serializable {

	private static final long serialVersionUID = -541041605283726718L;
	@Id
	@GeneratedValue
	@Column(name="id")
	private Integer id;
	
	@Basic
	@Column(name="name")
	private String name;
	
	@Basic
	@Column(name="max_param")
	private Integer max;
	
	@Basic
	@Column(name="sort_param")
	private String sortParam;
	
	@Basic
	@Column(name="sort_order")
	private String sortOrder;
	
	@ManyToOne
	@JoinColumn(name="CONTENT_ID")
	private Content content;
	
	
	@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
	@JoinTable(schema="vvins", name="VV_LIST_QUERY", joinColumns=@JoinColumn(name="LIST_ID"), inverseJoinColumns=@JoinColumn(name="QUERY_ID"))
	private List<ListQuery> queries;
	
	public ListContent() {
	}

	public ListContent(String name) {
		this.name = name;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<ListQuery> getQueries() {
		return queries;
	}

	public void setQueries(List<ListQuery> queries) {
		this.queries = queries;
	}

	public Integer getMax() {
		return max;
	}

	public void setMax(Integer max) {
		this.max = max;
	}

	public String getSortOrder() {
		return sortOrder;
	}

	public void setSortOrder(String sortOrder) {
		this.sortOrder = sortOrder;
	}

	public String getSortParam() {
		return sortParam;
	}

	public void setSortParam(String sortParam) {
		this.sortParam = sortParam;
	}

	public Content getContent() {
		return content;
	}

	public void setContent(Content content) {
		this.content = content;
	}

	

}
